<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp" %>
<div id="SaveOrUpdateDevWin"
	style="width: 600px; height: 410px; padding: 10px;overflow-y: auto;"
	class="easyui-dialog" title="申请操作"
	data-options="modal:true,closed:true,minimizable:false,collapsible:false,maximizable:false,iconCls:'icon-save',onClose:function(){$('#saveOrUpdateDevForm')[0].reset();} ">
	<form id="saveOrUpdateDevForm" method="post" enctype="multipart/form-data" >
	       <!--身份证号  -->
	      <input type="hidden" id="sfzmhm" />
	      <input type="hidden" id="hpzl" />
	      <input type="hidden" id="xh"/>
		<div class="menu_form_body">
		  <table  border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td align="left" width="160" height="40" style="padding: 3px;"
						class="tangchukuangliebiao1">号牌种类：
							<input id="hpzlSelect" class="easyui-combobox shurukuangkais"/>
					</td>
					<td align="right" width="100" height="40"
						class="tangchukuangliebiao1" style="padding: 3px;">
						<input id="hpSelect" style="width: 95%;" type="text" class="shurukuangkais" placeholder="请输入号牌号码" value="" />
					</td>
					<td align="left" width="150" class="tangchukuangliebiao1">
						<a href="###" class="congzhim" id="shenqingcx" style="margin: 0 5px 2px 0;">查询</a>
					</td>
				</tr>
			</table>
			<table name="hphm" border="0" cellpadding="0" cellspacing="0" width="100%" class="cheliangxinxi">
			   <tr>
	         	 <th align="right" height="26" width="100">号牌号码：</th>
	             <td>
	                 <span class="indexstylelist" id="hphmmc"></span>
	             </td>
	             <th align="right" height="26" width="100">号牌种类：</th>
	             <td>
	             		<span class="indexstylelist" id="hpzlmc"></span>
	             </td>
	         </tr>
	     	 <tr>
	         	 <th align="right" height="26">车辆品牌：</th>
	             <td>
	                 <span class="indexstylelist" id="clpp1"></span>
	             </td>
	             <th align="right" height="26">车身颜色：</th>
                 <td>
                     <span class="indexstylelist" id="csysmc"></span>
                 </td>
	         </tr>
	     	 <tr>
	     	     <th align="right" height="26">所有人：</th>
                 <td>
                     <span class="indexstylelist" id="syr"></span>
                 </td>
	         	 <th align="right" height="26">发动机号：</th>
	             <td>
	                   <span class="indexstylelist" id="fdjh"></span>     
	             </td>
	         </tr>
	         <tr>
	             <th align="right" height="26">车辆识别代号：</th>
	             <td>
	             	<span class="indexstylelist" id="clsbdh"></span>
	             </td>
	             <th align="right">外廓尺寸：</th>
	             <td>
	             	<span class="indexstylelist" id="wkccmc"></span>
	             </td>
	           </tr>
	           <tr>
	               <th align="right">备注：</th>
	               <td colspan="3">
	                  <input id="bz" class="easyui-textbox" data-options="multiline:true"  style="width:100%;height:100px;"/>
	                </td>
	           </tr>
			</table>
			<div class="shenqinganniudss" id="dd" style="display:none;">
				<a href="###" class="sousuocx" id="applyPrint" applyType="01" style="padding: 1px 10px; margin: 0 4px 0 0;">申请打印</a>
				<a href="###" class="sousuocx" id="applyDownload" applyType="02" style="padding: 1px 10px; margin: 0 4px 0 0;">申请下载</a>
				<a href="###" class="sousuocx2" id="applyDelete" applyType="03" style="padding: 1px 10px; margin: 0 4px 0 0;">申请删除</a>
			</div>
		</div>
	</form>
</div>

<script type="text/javascript">
   $(function(){
       //初始化号牌种类下拉框
       initSelect('hpzlSelect','请选择号牌种类','dmz','dmsm1','${ctx}/code/findHpzl.htm');
	   $('#applyPrint,#applyDownload,#applyDelete').unbind('click').bind('click',function(data){
		   var bz=$.trim($('#bz').val());
		   if(bz.length>400){
			   bz=bz.substring(0,400);
		   }
		   var $this=$(this);
		   var applyType=$this.attr('applyType');
           var sfzmhm=$('#sfzmhm').val();
           var hphm=$('#hphmmc').text();
           var message=$this.text();
           var hpzl=$.trim($('#hpzl').val());//号牌种类
           var xh=$('#xh').val();
           if(confirm('确认'+message+'？')){
        	   $.ajax({
                   type:'post',
                   url:'${ctx}/audit/addAudit.htm',
                   data:{
                      hphm:hphm,
                      sfzmhm:sfzmhm,
                      permissionType:applyType,
                      hpzl:hpzl,
                      bz:bz,
                      xh:xh
                   },
                   success:function(data){
                      if(data=='00'){
                          alert('申请失败，请稍后再试');
                      }else if(data=='01'){
                          alert('申请成功');
                      }else if(data=='02'){
                          alert('该权限已申请成功，不用再次申请');
                      }
                   }
                });
           }
	   });
	   
	   //查询
	   $('#shenqingcx').unbind('click').bind('click',function(){
		   clearInfo();
		   var hphm=$.trim($('#hpSelect').val());//号牌号码
		   if(hphm==''){
		       alert('请输入号牌号码！');
		       return false;
		   }
		   var hpzl=$.trim($('#hpzlSelect').combobox('getValue'));//号牌种类
		   if(hpzl==''){
		       alert('请选择号牌种类!');
		       return false;
		   }
		   var reg = /[\u4e00-\u9fa5]/g;//筛选是否有中文
		   hphm = hphm.replace(reg, "");
		   if(hphm!='' ){
		       $.ajax({
		           type:'post',
		           url:'${ctx}/yxxx/queryVehcile.htm',
		           data:{
		               hphm:hphm,
		               hpzl:hpzl
		           },
		           dataType:'json',
		           success:function(data){
		        	   debugger;
		               if(data!=''){
		            	   $('#dd').show();
		            	   var fzjg=data.fzjg;
		            	   if(null!=fzjg && undefined!=fzjg){
		            		   fzjg=fzjg[0];
		            	   }
		            	   $('#sfzmhm').val(data.sfzmhm);
		            	   $('#hpzl').val(data.hpzl);
		            	   $('#hphmmc').text(fzjg+data.hphm);
		            	   $('#hpzlmc').text(data.hpzlmc);
		            	   $('#clpp1').text(data.clpp1);
	                       $('#csysmc').text(data.csysmc);
	                       $('#syr').text(data.syr);
	                       $('#fdjh').text(data.fdjh);
	                       $('#clsbdh').text(data.clsbdh);
	                       $('#xh').val(data.xh);//机动车序号
	                       var wkccmc='长:' + data.cwkc+' 宽:'+data.cwkk+' 高:'+data.cwkg;
	                       $('#wkccmc').text(wkccmc);
		               }else{
		            	   $('#dd').hide();
		            	   alert('该号牌号码不存在，请重新输入');
		               }
		           }
		       });
		   }else{
			   alert('请输入号牌号码!');
		   }
		});
   });
</script>